feat: add modules.contentControls.chrome#3486
Conversation
|
📖 Docs preview: https://superdoc-artem-sd-3159.mintlify.app |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fd30dbe to
96d8cbf
Compare
96d8cbf to
d74b1dd
Compare
d74b1dd to
f40afd1
Compare
f40afd1 to
ca994b6
Compare
ca994b6 to
44f484e
Compare
44f484e to
6a9fff4
Compare
6a9fff4 to
95e8ebe
Compare
95e8ebe to
35f15e8
Compare
|
@artem-harbour, @caio-pizzol - fixed conflicts. Can you please review? |
35f15e8 to
576b56e
Compare
Resolve conflicts in painters/dom/src/styles.ts and index.test.ts. main refactored block SDT chrome to ::before (background) / ::after (border) pseudo-elements after this branch forked. The branch's chrome-none opt-out only targeted element-level selectors, which cannot override pseudo-element paint, so block chrome (hover fill, selected blue border, lock-hover fill) leaked under contentControlsChrome=none. Add .superdoc-cc-chrome-none suppression for the block pseudo-elements, including the selected-node ::after border and the lock-hover ::before background, declared after every chrome-showing pseudo rule so source order resolves equal-specificity ties (matching the viewing-mode rules). index.test.ts: keep both sides' added tests (the branch's three chrome-none tests and main's block-chrome-width/image/empty-SDT tests). styles.test.ts: assert the new pseudo-element suppression selectors.
… visuals Set modules.contentControls.chrome: 'none' so the demo shows the intended SD-3159 use case: built-in SDT chrome off, host owns the visuals. Smart-field pills and clause cards are now host-painted under .superdoc-cc-chrome-none (scoped so they sit above the painter's reset), and the painter-label CSS is dropped since no label element is emitted. The contextual field chip is unchanged and still anchors via getRect, which keeps working because wrappers and data-sdt-* datasets are kept.
…rder Cover the :hover ::before/::after suppression selectors and add an order assertion: the chrome-none block must be declared after the lock-hover ::before rule. Those hover selectors are equal specificity to the rules they override, so source order is what makes them win; the assertion guards against a future reorder silently re-leaking hover chrome under contentControlsChrome=none.
Second integration of main, which advanced into the same SDT-chrome area right after the prior merge. main moved the block SDT fill onto the ::before chrome layer (behind content) instead of the wrapper element. The chrome-none suppression already neutralizes ::before background at the base selector, so the relocated fill is covered; verified in-browser that block fill, border, hover, selection and lock-hover stay suppressed under contentControlsChrome=none. Only index.test.ts conflicted (interleaved new image/empty-SDT tests with the chrome-none tests); kept both sides.
Close review-feedback coverage gaps for modules.contentControls.chrome: - SuperDoc.test.js: assert SuperDoc.vue forwards modules.contentControls.chrome into the PresentationEditor layout options (and stays undefined when unset). This is the public consumer path; DomPainter unit tests exercised the option but not the wiring. - consumer-typecheck: pin that modules.contentControls.chrome: 'none' compiles for a consumer across the tsconfig matrix. - table tests: assert chrome: 'none' suppresses the label but keeps the wrapper for a table-level SDT and a nested-table SDT in a cell; the threading through fragment/row/cell had no coverage. - virtualization.test.ts: restore the page-0 eviction assertion that the PR had dropped, so the remount test again proves eviction happened first (verified it still passes). - styles.ts: scope the chrome-opt-out comment to structured-content labels; documentSection chrome is intentionally preserved.
contentControls has a single real runtime option: SuperDoc.vue reads modules.contentControls.chrome and forwards nothing else. The & Record<string, unknown> intersection (mirrored from sibling module configs that genuinely forward extra keys) gave no typo safety for the new public option, and made the consumer fixture pin a pass-through contract that does not exist. Drop the index signature and the fixture's forwardedFlag so an unknown contentControls key is now a compile error.
The header claimed every modules.X shape is intentionally open. That is now false: configs that forward runtime extras stay open, but contentControls (one real option, no forwarding) is intentionally exact. Reword so the file documents both policies. Comment-only.
caio-pizzol
left a comment
There was a problem hiding this comment.
hey @artem-harbour, thanks for the updates.
i pushed a few follow-up commits to finish the chrome-none work, add missing coverage, and tighten the public config type.
lgtm once CI is green.
|
🎉 This PR is included in superdoc-cli v0.15.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc-sdk v1.14.0 |
|
🎉 This PR is included in @superdoc-dev/mcp v0.10.0 The release is available on GitHub release |
|
🎉 This PR is included in superdoc v1.38.0 The release is available on GitHub release |
|
🎉 This PR is included in @superdoc-dev/react v1.9.0 The release is available on GitHub release |
|
🎉 This PR is included in vscode-ext v2.10.0 |
Linear: SD-3159
Introduces
modules.contentControls.chrome('default' | 'none') to let consumers disable built-in content-control chrome while preserving SDT data, wrappers, and geometry APIs.What changed:
modules.contentControls.chrome).SuperDoc.vue→LayoutEngineOptions→PresentationEditor→DomPainter.chrome: 'none':superdoc-cc-chrome-nonecreateInlineSdtWrapper)applySdtContainerStyling(..., chrome)across all paths, including nested tables.documentSectiontooltip behavior unchanged (suppression applies only to structured content/content controls).